'''
no 4        字符串常规操作
'''
stri = 'i love you python'
print(stri)                 # i love you python
print(stri[5])              # e
print(stri[0:5])            # i lov
print(stri[:5])             # i lov
print(stri[5:])             # e you python
print(stri.find('o'))       # 3
print(stri.index('o'))      # 3
print(stri.find('x'))       #-1
# print(stri.index('x'))    # get a error 'ValueError
print(stri[-4])             # t
print(stri[:-4])            # i love you py
print(stri[-4:])            # thon
print(stri[-8:-4])          # u py
print(stri[-4:-8] == '')    # True
print(len(stri[-4:-8]) == 0)    # True
print(stri.replace('o','p'))    # i lpve ypu pythpn